package com.greate.community.controller.master;

import com.greate.community.entity.admin_master.Section;
import com.greate.community.service.master.SectionForbidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 禁止评论
 */
@RestController
@RequestMapping("/forbid")
public class SectionForbidController {

    @Autowired
    private SectionForbidService sectionForbidService;

    @RequestMapping("/getAllSectionInfo")
    public List<Section> getAllSection(){
        return sectionForbidService.getAllSection();
    }

    /**
     * 所有版块禁言
     * @return
     */
    @RequestMapping("/allSectionForbid")
    public String allSectionForbid(){
        return sectionForbidService.allSectionForbid();
    }

    /**
     * 取消所有版块禁言
     * @return
     */
    @RequestMapping("/cancelSectionForbid")
    public String cancelSectionForbid(){
        return sectionForbidService.cancelSectionForbid();
    }

    /**
     * 某些版块禁言
     * @return
     */
    @RequestMapping(value ="/someSectionForbid",method = RequestMethod.POST )
    public String someSectionForbid(@RequestBody List<Integer> sections){

        return sectionForbidService.someSectionForbid(sections);
    }

    /**
     * 取消某些板块禁言
     * @return
     */
    @RequestMapping(value ="/cancelSomeSectionForbid",method = RequestMethod.POST )
    public String cancelSomeSectionForbid(@RequestBody List<Integer> sections){
        return sectionForbidService.cancelSomeSectionForbid(sections);
    }
}
